<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
		<div class="right">
			<div class='hd_title'>
				<strong>标签云</strong>	
			</div>
			<div id="tagBox" class='tags'>
				<?php
if(1000){
	$tagData = K('Tag')->limit('1000')->where('')->all();
}else{
	$tagData = K('Tag')->where('')->all();
}
foreach ($tagData as $filed):
$filed['url'] = U('List/index',array('tid'=>$filed['tid']));
?>

				<a href="<?php echo $filed['url'];?>"><?php echo $filed['tagname'];?></a>	
				
<?php
endforeach
?>		
			</div>
			<div class='hd_title'>
				<strong>热门文章</strong>	
			</div>
			<ul class='arc_list'>
				<?php
	//如果有分页的话
	if(0){
		$total = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%热门%' AND category_cid IN (4)")->count();
		$pageObj = new Page($total,0,5);
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%热门%' AND category_cid IN (4)")->limit($pageObj->limit())->order("sendtime DESC")->all();
		$page = $pageObj->show();
	}else{
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%热门%' AND category_cid IN (4)")->limit("2")->order("sendtime DESC")->all();
	}
    foreach ($arcData as $filed):
    $filed['url']=U('Content/index',array('aid'=>$filed['aid']));
   //组合分类的url
   $field['curl'] = U('List/index',array('cid'=>$field['cid']));
   
    //评论总数
    $filed['total'] = M('comment')->where("article_aid=" . $filed['aid'])->count();
    
?>

					<li>
						<div class='image'>
							<a href="<?php echo $filed['url'];?>">
								<img src="http://127.0.0.1/cms_edu/<?php echo $filed['thumb'];?>
" alt=""/>
							</a>
						</div>
						<h2><a href="<?php echo $filed['url'];?>"><?php echo mb_substr($filed['title'],0,17,'utf-8');?>...</a></h2>
						<p>
							<em><?php echo date('y-m-d',$filed['sendtime']);?></em><span><?php echo $filed['total'];?>条评论</span>
						</p>
					</li>
				
<?php
endforeach
?>
			</ul>
			<div class='hd_title'>
				<strong>推荐文章</strong>	
			</div>
			
			<ul class='arc_list'>
				<?php
	//如果有分页的话
	if(0){
		$total = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%推荐%' AND category_cid IN (4)")->count();
		$pageObj = new Page($total,0,5);
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%推荐%' AND category_cid IN (4)")->limit($pageObj->limit())->order("sendtime DESC")->all();
		$page = $pageObj->show();
	}else{
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("is_recycle=0 AND attr like '%推荐%' AND category_cid IN (4)")->limit("2")->order("sendtime DESC")->all();
	}
    foreach ($arcData as $filed):
    $filed['url']=U('Content/index',array('aid'=>$filed['aid']));
   //组合分类的url
   $field['curl'] = U('List/index',array('cid'=>$field['cid']));
   
    //评论总数
    $filed['total'] = M('comment')->where("article_aid=" . $filed['aid'])->count();
    
?>

				
				<li>
						<div class='image'>
							<a href="<?php echo $filed['url'];?>">
								<img src="http://127.0.0.1/cms_edu/<?php echo $filed['thumb'];?>
" alt=""/>
							</a>
						</div>
						<h2><a href="<?php echo $filed['url'];?>"><?php echo mb_substr($filed['title'],0,17,'utf-8');?>...</a></h2>
						<p>
							<em><?php echo date('y-m-d',$filed['sendtime']);?></em><span><?php echo $filed['total'];?>条评论</span>
						</p>
					</li>
					
			
<?php
endforeach
?>
			</ul>
		</div>
		<!-- 右侧区域结束 -->